﻿using System;
using System.Collections.Specialized;
using System.Windows.Controls.Primitives;

namespace Gmantis.Controls
{
    public class ItemsChangedEventArgs : EventArgs
    {
        // Fields
        private NotifyCollectionChangedAction _action;
        private int _itemCount;
        private int _itemUICount;
        private GeneratorPosition _oldPosition;
        private GeneratorPosition _position;

        // Methods
        internal ItemsChangedEventArgs(NotifyCollectionChangedAction action, GeneratorPosition position, int itemCount, int itemUICount)
            : this(action, position, new GeneratorPosition(-1, 0), itemCount, itemUICount)
        {
        }

        internal ItemsChangedEventArgs(NotifyCollectionChangedAction action, GeneratorPosition position, GeneratorPosition oldPosition, int itemCount, int itemUICount)
        {
            this._action = action;
            this._position = position;
            this._oldPosition = oldPosition;
            this._itemCount = itemCount;
            this._itemUICount = itemUICount;
        }

        // Properties
        public NotifyCollectionChangedAction Action
        {
            get
            {
                return this._action;
            }
        }

        public int ItemCount
        {
            get
            {
                return this._itemCount;
            }
        }

        public int ItemUICount
        {
            get
            {
                return this._itemUICount;
            }
        }

        public GeneratorPosition OldPosition
        {
            get
            {
                return this._oldPosition;
            }
        }

        public GeneratorPosition Position
        {
            get
            {
                return this._position;
            }
        }
    }
}
